home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Education / PC-SiG's World of Education.iso / run / 2602 / datarec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-06  |  2.0 KB  |  64 lines

  1. /************************ DATAREC.H ***********************/
  2. /* Record structures for files written and read from disk
  3.         for DAN
  4.         last mod: 10/5/88
  5. */
  6.  
  7. /* HEADER RECORD */
  8. /* NOTE: A HEADER RECORD IS NOT NECESSARY FOR PROPER DAN OPERATION */
  9. struct    header_record {
  10.     int        hr_type,            /* record type (= 1) */
  11.             hr_attrib,            /* file attribute codes (TBD) */
  12.             hr_num_recs,        /* number of data records */
  13.             hr_smooth;            /* smoothing factor used */
  14.     char    hr_date[10],        /* date file created */
  15.             hr_label[80],        /* label information */
  16.             hr_xunits[80],        /* X axis units name for data in this file */
  17.             hr_yunits[80];
  18.     double    hr_start,            /* start time for data */
  19.             hr_bias,            /* bias time */
  20.             hr_dur,                /* processing time duration (seconds) */
  21.             hr_step;            /* time incr between successive data pts (seconds) */
  22.     char    hr_version[4];        /* DAN version number */
  23. };
  24. typedef struct header_record HR;
  25.  
  26.  
  27.  
  28. struct datapt {
  29.         double    x,                /* time tag or x coord assoc with data point */
  30.                 fx;                /* f(x),data point value or y coord */
  31. };
  32.  
  33.  
  34.  
  35. /* DATA_RECORD - defines DAN Data File format.
  36.                 Files written with records in this format can be used
  37.                 directly in DAN expressions.
  38. */
  39. struct data_record {
  40.     int        dr_type,            /* record type (=7) */
  41.             dr_pts,                /* num data pts in record (0-63)*/
  42.             dr_rec_num,            /* current record number (these values are not) */
  43.             dr_nxt_rec;            /* next record number    ( used by DAN      ) */
  44.             /* up to 63 data points per rec */
  45.     struct    datapt dp[63];
  46.     int        dr_slop[4];            /* fill out record to 1024 bytes */
  47. };
  48. typedef struct data_record DR;
  49.  
  50.  
  51.  
  52. /* OUTPUT_FILE  - structure used by 'store_data' routine */
  53. struct output_file {
  54.     int    open;                    /* file status flg:     */
  55.                                 /*    0 = not opened    */
  56.                                 /*    1 = open          */
  57.                                 /*    2 = unable to open */
  58.                                 /*    3 = unrecoverable write error */
  59.     FILE *fid;                    /* file stream ptr */
  60.     char name[40];                /* file name */
  61.     DR    *bfr;                    /* ptr to output buffer */
  62. };
  63. typedef struct output_file OF;
  64.